package com.qian.apiserver.entity;

import com.yaowk.service.common.BaseEntity;
import com.yaowk.service.common.GeneratorNote;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;


@Getter
@Setter
@ToString
@DynamicInsert
@DynamicUpdate
@Entity
/**
 * 充值记录
 */
public class GmOrder extends BaseEntity<Integer> {

    @GeneratorNote("充值金额")
    private BigDecimal money;
    @GeneratorNote("充值类型")
    private Byte type;
    @GeneratorNote("充值数量")
    private BigDecimal number;
    @GeneratorNote("充值时间")
    private Date time;
    @GeneratorNote("充值方式")
    private Byte way;
    @GeneratorNote("状态")
    private Byte status;    //0:待充值 1:充值成功 2:撤回支付
    @GeneratorNote("充值获得宝石数")
    private BigDecimal gemstone;
    @GeneratorNote("用户Id")
    @Column(insertable = false,updatable = false)
    private Integer userId;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "userId")
    private GmUser user;
}
